package com.kylin.dal.entity.authority;

import com.kylin.shared.common.entity.BaseEntry;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 权限系统中的操作日志数据项
 * @author Damon S.
 * @version v1.0.1
 * @date 2019年11月01日 10:57
 */
@Entity
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_authority_log", catalog = "db_kylin_artwork")
public final class OperateLogEntry extends BaseEntry implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column private Long id;

    @Column(name = "ip", length = 128)
    private String sourceIp;

    @Column(name = "user_id")
    private Long userId;

    @Column(length = 16)
    private String username;

    @Column(length = 32)
    private String operate;

    @Column(length = 512)
    private String uri;

    @Column private Long duration;

    @Column(columnDefinition = "TEXT")
    private String params;

    @Column(columnDefinition = "TINYINT")
    private Integer removed;
}
